<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .point-chart {
        width: 600px;
        height: 600px;
        border: 1px solid #000;
      }
    </style>
  </head>
  <body>
    <div class="point-chart"></div>
    <script src="js/jquery.min.js"></script>
    <script src="js/echarts.min.js"></script>
    <script>
      let myChart = echarts.init(document.querySelector(".point-chart"));
      const dataAll = [
        {
          expect: [24, 40, 101, 134, 90, 230, 210, 230, 120, 230, 210, 120],
          actual: [40, 64, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79],
        },
        {
          expect: [23, 75, 12, 97, 21, 67, 98, 21, 43, 64, 76, 38],
          actual: [43, 31, 65, 23, 78, 21, 82, 64, 43, 60, 19, 34],
        },
        {
          expect: [34, 87, 32, 76, 98, 12, 32, 87, 39, 36, 29, 36],
          actual: [56, 43, 98, 21, 56, 87, 43, 12, 43, 54, 12, 98],
        },
        {
          expect: [43, 73, 62, 54, 91, 54, 84, 43, 86, 43, 54, 53],
          actual: [32, 54, 34, 87, 32, 45, 62, 68, 93, 54, 54, 24],
        },
      ];
      let option = {
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          { offset: 0, color: "#00f8f9" },
          { offset: 1, color: "#0067d0" },
        ]),
        grid: {
          containLabel: true,
          left: 0,
          top: 30,
          right: 10,
          bottom: 0,
        },
        legend: {
          data: ["预期销售额", "实际销售额"],
          right: 30,
          textStyle: {
            color: "rgba(66, 196, 40, 1)",
          },
        },
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: [
            "1月",
            "2月",
            "3月",
            "4月",
            "5月",
            "6月",
            "7月",
            "8月",
            "9月",
            "10月",
            "11月",
            "12月",
          ],
          axisLabel: {
            show: true,
            color: "#4c9bfd",
          },
          axisTick: {
            show: false,
          },
        },
        yAxis: {
          type: "value",
          axisLabel: {
            show: true,
            color: "#4c9bfd",
          },
          name: "单位:万",
          nameLocation: "end",
          nameTextStyle: {
            align: "left",
            color: "skyblue",
          },
          axisTick: {
            show: false,
          },
          splitLine: {
            lineStyle: {
              color: "#004e61",
            },
          },
        },
        series: [
          {
            name: "预期销售额",
            type: "line",
            // stack: "总量",
            data: dataAll[0].expect,
            smooth: true,
            itemStyle: {
              color: "#00f2f1",
            },
          },
          {
            name: "实际销售额",
            type: "line",
            // stack: "总量",
            data: dataAll[0].actual,
            smooth: true,
            itemStyle: {
              color: "#e63e35",
            },
          },
        ],
      };
      myChart.setOption(option);
    </script>
  </body>
</html>
